<?php
/**
 * InlineResponse2005
 *
 * PHP version 5
 *
 * @category Class
 * @package  AmazonAdvertisingApi
 * @author   vv_guo
 * @link    https://gitee.com/HuaLiLiDeDiDiao/amazon-advertising-api
 */

/**
 * Amazon Ads API - Sponsored Brands
 *
 * Use the Amazon Ads API for Sponsored Brands for campaign, ad group, keyword, negative keyword, drafts, Stores, landing pages, and Brands management operations. For more information about Sponsored Brands, see the [Sponsored Brands Support Center](https://advertising.amazon.com/help#GQFZA83P55P747BZ). For onboarding information, see the [account setup](https://advertising.amazon.com/API/docs/v3/guides/account_setup) topic.
 *
 * OpenAPI spec version: 3.0
 * 
 * Generated by:https://gitee.com/HuaLiLiDeDiDiao/amazon-advertising-api.git
 * AmazonAdvertisingApi Codegen version: 3.0.51
 */
/**
 * NOTE: This class is auto generated by the AmazonAdvertisingApi code generator program.
 *https://gitee.com/HuaLiLiDeDiDiao/amazon-advertising-api
 * Do not edit the class manually.
 */

namespace AmazonAdvertisingApi\Model;

use \ArrayAccess;
use \AmazonAdvertisingApi\ObjectSerializer;

/**
 * InlineResponse2005 Class Doc Comment
 *
 * @category Class
 * @package  AmazonAdvertisingApi
 * @author   vv_guo
 * @link    https://gitee.com/HuaLiLiDeDiDiao/amazon-advertising-api
 */
class InlineResponse2005 implements ModelInterface, ArrayAccess
{
    const DISCRIMINATOR = null;

    /**
      * The original name of the model.
      *
      * @var string
      */
    protected static $AmazonAdvertisingApiModelName = 'inline_response_200_5';

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $AmazonAdvertisingApiTypes = [
        'media_id' => '\AmazonAdvertisingApi\Model\MediaId',
        'status' => '\AmazonAdvertisingApi\Model\MediaStatus',
        'status_metadata' => '\AmazonAdvertisingApi\Model\InlineResponse2005StatusMetadata[]',
        'published_media_url' => 'string',
        'original_media_url' => 'string'
    ];

    /**
      * Array of property to format mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $AmazonAdvertisingApiFormats = [
        'media_id' => null,
        'status' => null,
        'status_metadata' => null,
        'published_media_url' => null,
        'original_media_url' => null
    ];

    /**
     * Array of property to type mappings. Used for (de)serialization
     *
     * @return array
     */
    public static function AmazonAdvertisingApiTypes()
    {
        return self::$AmazonAdvertisingApiTypes;
    }

    /**
     * Array of property to format mappings. Used for (de)serialization
     *
     * @return array
     */
    public static function AmazonAdvertisingApiFormats()
    {
        return self::$AmazonAdvertisingApiFormats;
    }

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name
     *
     * @var string[]
     */
    protected static $attributeMap = [
        'media_id' => 'mediaId',
        'status' => 'status',
        'status_metadata' => 'statusMetadata',
        'published_media_url' => 'publishedMediaUrl',
        'original_media_url' => 'originalMediaUrl'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'media_id' => 'setMediaId',
        'status' => 'setStatus',
        'status_metadata' => 'setStatusMetadata',
        'published_media_url' => 'setPublishedMediaUrl',
        'original_media_url' => 'setOriginalMediaUrl'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'media_id' => 'getMediaId',
        'status' => 'getStatus',
        'status_metadata' => 'getStatusMetadata',
        'published_media_url' => 'getPublishedMediaUrl',
        'original_media_url' => 'getOriginalMediaUrl'
    ];

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name
     *
     * @return array
     */
    public static function attributeMap()
    {
        return self::$attributeMap;
    }

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @return array
     */
    public static function setters()
    {
        return self::$setters;
    }

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @return array
     */
    public static function getters()
    {
        return self::$getters;
    }

    /**
     * The original name of the model.
     *
     * @return string
     */
    public function getModelName()
    {
        return self::$AmazonAdvertisingApiModelName;
    }



    /**
     * Associative array for storing property values
     *
     * @var mixed[]
     */
    protected $container = [];

    /**
     * Constructor
     *
     * @param mixed[] $data Associated array of property values
     *                      initializing the model
     */
    public function __construct(array $data = null)
    {
        $this->container['media_id'] = isset($data['media_id']) ? $data['media_id'] : null;
        $this->container['status'] = isset($data['status']) ? $data['status'] : null;
        $this->container['status_metadata'] = isset($data['status_metadata']) ? $data['status_metadata'] : null;
        $this->container['published_media_url'] = isset($data['published_media_url']) ? $data['published_media_url'] : null;
        $this->container['original_media_url'] = isset($data['original_media_url']) ? $data['original_media_url'] : null;
    }

    /**
     * Show all the invalid properties with reasons.
     *
     * @return array invalid properties with reasons
     */
    public function listInvalidProperties()
    {
        $invalidProperties = [];

        return $invalidProperties;
    }

    /**
     * Validate all the properties in the model
     * return true if all passed
     *
     * @return bool True if all properties are valid
     */
    public function valid()
    {
        return count($this->listInvalidProperties()) === 0;
    }


    /**
     * Gets media_id
     *
     * @return \AmazonAdvertisingApi\Model\MediaId
     */
    public function getMediaId()
    {
        return $this->container['media_id'];
    }

    /**
     * Sets media_id
     *
     * @param \AmazonAdvertisingApi\Model\MediaId $media_id media_id
     *
     * @return $this
     */
    public function setMediaId($media_id)
    {
        $this->container['media_id'] = $media_id;

        return $this;
    }

    /**
     * Gets status
     *
     * @return \AmazonAdvertisingApi\Model\MediaStatus
     */
    public function getStatus()
    {
        return $this->container['status'];
    }

    /**
     * Sets status
     *
     * @param \AmazonAdvertisingApi\Model\MediaStatus $status status
     *
     * @return $this
     */
    public function setStatus($status)
    {
        $this->container['status'] = $status;

        return $this;
    }

    /**
     * Gets status_metadata
     *
     * @return \AmazonAdvertisingApi\Model\InlineResponse2005StatusMetadata[]
     */
    public function getStatusMetadata()
    {
        return $this->container['status_metadata'];
    }

    /**
     * Sets status_metadata
     *
     * @param \AmazonAdvertisingApi\Model\InlineResponse2005StatusMetadata[] $status_metadata status_metadata
     *
     * @return $this
     */
    public function setStatusMetadata($status_metadata)
    {
        $this->container['status_metadata'] = $status_metadata;

        return $this;
    }

    /**
     * Gets published_media_url
     *
     * @return string
     */
    public function getPublishedMediaUrl()
    {
        return $this->container['published_media_url'];
    }

    /**
     * Sets published_media_url
     *
     * @param string $published_media_url The preview URL of the media. It is only available when status is `Available`.
     *
     * @return $this
     */
    public function setPublishedMediaUrl($published_media_url)
    {
        $this->container['published_media_url'] = $published_media_url;

        return $this;
    }

    /**
     * Gets original_media_url
     *
     * @return string
     */
    public function getOriginalMediaUrl()
    {
        return $this->container['original_media_url'];
    }

    /**
     * Sets original_media_url
     *
     * @param string $original_media_url This is a signed URL which returns the original media in .mp4 file extension. The URL is only active for 7 days and requires to be regenerated if the video is not downloaded within 7 days. If you try to upload the downloaded video using the Asset Library API and get an error, then please retry upload after changing the file extension to .mov.
     *
     * @return $this
     */
    public function setOriginalMediaUrl($original_media_url)
    {
        $this->container['original_media_url'] = $original_media_url;

        return $this;
    }
    /**
     * Returns true if offset exists. False otherwise.
     *
     * @param integer $offset Offset
     *
     * @return boolean
     */
    #[\ReturnTypeWillChange]
    public function offsetExists($offset)
    {
        return isset($this->container[$offset]);
    }

    /**
     * Gets offset.
     *
     * @param integer $offset Offset
     *
     * @return mixed
     */
    #[\ReturnTypeWillChange]
    public function offsetGet($offset)
    {
        return isset($this->container[$offset]) ? $this->container[$offset] : null;
    }

    /**
     * Sets value based on offset.
     *
     * @param integer $offset Offset
     * @param mixed   $value  Value to be set
     *
     * @return void
     */
    #[\ReturnTypeWillChange]
    public function offsetSet($offset, $value)
    {
        if (is_null($offset)) {
            $this->container[] = $value;
        } else {
            $this->container[$offset] = $value;
        }
    }

    /**
     * Unsets offset.
     *
     * @param integer $offset Offset
     *
     * @return void
     */
    #[\ReturnTypeWillChange]
    public function offsetUnset($offset)
    {
        unset($this->container[$offset]);
    }

    /**
     * Gets the string presentation of the object
     *
     * @return string
     */
    public function __toString()
    {
        if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
            return json_encode(
                ObjectSerializer::sanitizeForSerialization($this),
                JSON_PRETTY_PRINT
            );
        }

        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
    }
}
